import request from "@/utils/request";

export function login(data) {
  return request({
    url: "back/login",
    method: "post",
    data
  });
}

export function getInfo(token) {
  return {
    roles: ["admin"],
    introduction: "I am a super administrator",
    avatar:
      "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
    name: "Super Admin"
  };
  // return request({
  //   url: '/user/info',
  //   method: 'get',
  //   params: { token }
  // })
}

export function logout() {
  return request({
    url: "/user/logout",
    method: "post"
  });
}

export function setPageSetting(data) {
  return request({
    url: "back/terrace/setting?type=setSetting",
    data,
    method: "post"
  });
}

export function getPageSetting(data) {
  return request({
    url: "back/terrace/setting?type=getSetting",
    data,
    method: "post"
  });
}